<template>
	<view>
		<image :src="`http://192.168.2.218:8086/business/common2/download?name=${OrderMsg.picture}`" mode="aspectFill" style="width: 100%;"></image>
		<view class="name">
			<text >{{OrderMsg.homestayName}}</text>
		</view>
		<view style="display: flex;flex-direction: column;margin-left: 20px;">

		<uni-rate allow-half :value="3.5" v-model="ScoreMsg.score" />
		<button class="reserve" @click="score_button()">提交</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ScoreMsg:{
					"score":'',
				},
				OrderMsg:{
				},
				Token:{
					"tokne":'',
				}
		}
		},
		onLoad:function(){
			this.OrderMsg=uni.getStorageSync('OderMsg');
			this.Token.tokne=uni.getStorageSync('login-user').token;
		},
		methods: {
			score_button() {
				console.log(this.ScoreMsg.score);
				this.OrderMsg.score=this.ScoreMsg.score;
				console.log(this.OrderMsg.score);
				uni.request({
					url:'http://192.168.2.218:8086/business/user/updateorder',
					method:'POST',
					header:{
						'token':this.Token.tokne
					},
					data:this.OrderMsg,
					success() {
						uni.showToast({
							icon:'success',
							title:'成功',
							
						})
					}
					
					
				})
			}

		},
	}
	
</script>

<style>
	.myreserve{
			display: flex;
			padding: 20px;
			box-shadow: 0 0 8rpx 5rpx rgba(81, 81, 81, 0.5);

	}
	.name{
	    margin-left: 20PX;
		margin-top: 10px;
		display: flex;
		/* 竖直排布 */
		flex-direction: column;
		/* 均匀分布 */

	}
	.myreserve image{
		width: 80px;
		height: 80px;
		margin-right: 20px;
	}
	.name{
		font-size: 13px;
		font-weight: 500;
	}
	.price{
		margin-top: 30px;
		font-size: 15px;
		font-weight: 900;
		color: red;

	}
	.reserve{
	    font-size: 15px;
		margin-top: 50px;
		margin-left: 30px;
		background-color: #ffaa00f0;
	}
</style>